﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Gencode.Gengui.Wizzard
{
    [ToolboxItem(false)]
	public partial class WizzardControl : GUControl// UserControl
	{
		public WizzardControl()
		{
			InitializeComponent();
		}

		public WizzardControl(string previousControl, string nextControl, IWizardControler controler)
		{
			this.controler = controler;
			this.previousControl = previousControl;
			this.nextControl = nextControl;

			InitializeComponent();
		}

		/// <summary>
		/// Checks if its allowed to move to next control
		/// </summary>
		/// <returns></returns>
		public virtual bool MoveNext()
		{
			return true;
		}

		/// <summary>
		/// Checks if its allowed to move to previous control
		/// </summary>
		/// <returns></returns>
		public virtual bool MovePrevious()
		{
			return true;
		}

		public virtual bool Finish()
		{
			return true;
		}

		protected string previousControl = "";
		/// <summary>
		/// Previous Control to be displayed
		/// </summary>
		public string PreviousControl
		{
			get
			{
				return previousControl;
			}
		}

		protected string nextControl = "";
		/// <summary>
		/// Next Control to be displayed
		/// </summary>
		public string NextControl
		{
			get
			{
				return nextControl;
			}
		}

		IWizardControler controler;
		/// <summary>
		/// Returns the Contoler asociated with this Dialog
		/// </summary>
		protected IWizardControler Controler
		{
			get
			{
				return controler;
			}
		}

		protected bool isInitialized = false;
		/// <summary>
		/// Initializes the wizzard control if isInitialized is false
		/// </summary>
		public virtual void InitializeWizzardControl()
		{
			if (isInitialized)
				return;
		}
	}
}
